import {
    live
  } from '@/services'
  
  const state = {
    liveData: {}
  };
  
  const getters = {
    
  };
  
  const mutations = {
    update(state, payload){
      for (let key in payload) {
        state[key] = payload[key];
      }
      console.log(state);
    }
  };
  
  const actions = {
    async liveList({commit}, payload) {
      let result = await live();
      if (result){
        commit('update', {liveData: result.data.room_info});
      }
    }
  };
  
  export default {
    namespaced: true,
    modules: {},
    state,
    getters,
    mutations,
    actions,
  }